#define LoadSpells
/* Load Spell List Script.
 * Each spell is defined as a vector with the following components in order :
 * name 
 * spell index
 * direct damage
 * turn based damage
 * duration of effects
 * area of effect (1 is single target and the are is a square)
 * effects bit set with the following positions : 0-slow, 1-haste, 2-hold, 4 frozen
 * mana cost
 * special index
 */
 
 //!! NEEDS STRING SPLIT ANYWAY !!!!! 
idx = -1;
file = file_text_open_read(global.SPELLS_LIST);
while(not file_text_eof(file)) {
    // OMFG !! You have to read the f*** line terminator !!!
    line = file_text_read_string(file);
    file_text_readln(file);
    //if there is a spell line
    if(string_char_at(line, 1) != '[') {
        i = string_pos('=', line);
        j = string_pos(',', line);
        show_message(string_copy(line, i + 1, j - i - 1));
        variable_global_array2_set('spell_table', idx, 
                                    real(string_copy(line, i + 1, 
                                                        j - i - 1)),
                                    line);
    } else {
    //move to the next line of the array
        idx+= 1;
    }
}
file_text_close(file);

show_message(global.spell_table[0 , 1]);

